# -*- coding: utf-8 -*-
# @Time     : 2021/4/22 17:34
# @Author   : pengrenjie
# @Email    : 941257162@.com
# @File     : 爬虫.py
import requests
import re

url = "https://www.sanchuangedu.cn"
result = requests.get(url)
result2 = result.content.decode("utf-8")
print(result2)
# p =r'<img src="(.*\.jpg)"'
imglist = re.findall(r'<img src="(.*\.jpg)',result2)
print(imglist)

for i in imglist:
     print(url+i)
     reimg = requests.get(url+i)
for j in range(len(imglist)):
     with open(f"{j}.jpg",'wb') as fp:
        fp.write(reimg.content)



